Put buttons inside ListBox [WPF]

Posted by Andrey on Stack Overflow See other posts from Stack Overflow or by Andrey
Published on 2010-06-11T16:07:05Z Indexed on 2010/06/11 16:22 UTC
Read the original article Hit count: 403

Filed under:
|

I want to create list of buttons, and i want buttons to spread across the list item space. Here is what i have:

    <ListBox Margin="44,54,134,0" Name="listView1" Height="64" >
        <Button Height="20"></Button>
        <Button Height="20"></Button>            
    </ListBox>

Result is:

alt text

First pic

I want something like second picture, but right side of button to stick to right side of list. I tried to bind in ItemTemplate to ListBox width, but this doesn't work for all cases (if width is Auto)

Thanks, Andrey

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf